<template>
  <m-page>
    <!-- 融易通卡首页 -->
    <m-header title="融易通卡首页"></m-header>

    <!-- 融易通卡首页 -->
    <!-- 如果没有办理融易通卡则显示宣传页 -->
    <!-- 有1张则直接进入融易通卡主页 -->
    <!-- 有2张或以上也显示卡列表页 -->
    <div class="publicity_page" v-if="this.hasCard == '0'">
      <p>融易通信用卡</p>
      <p>全面优化升级 只为有梦想的企业家</p>
      <p>最高额度500万元</p>
      <div class="apply_require">
        <div></div>
        <p>申请条件</p>
      </div>
      <p>信用方式，或提供抵押/质押/担保都可申办</p>

      <ynet-popup v-model="isPopupShow.bottom" position="bottom">
        <div class="md-example-popup md-example-popup-bottom">
          <span class="md-popup-item">您还没有融易通卡？</span>
          <span class="md-popup-item">马上去长沙银行营业网点咨询办理吧！</span>
          <span class="md-popup-tel">服务热线：40067-96511</span>
        </div>
      </ynet-popup>
    </div>

    <!-- 卡列表页 -->
    <div class="card_list">
      <div class="card_list_item" v-for="item in cardlist" :key="item.id" @click="gotoCardInfo()">
        <ynet-cell-item :title="item.cardname" :brief="item.account"  >
          <span class="holder" slot="left"></span>
          <p class="card_item_right" slot="right" v-if="item.isActived == '0'">未激活</p>
        </ynet-cell-item>
        <div class="card_quota">
          <p>总额度：<span>{{item.total_quota}}</span>万元</p>
          <p>可用额度：<span class="available_quota">{{item.available_quota}}</span>万元</p>
        </div>
      </div>
    </div>
  </m-page>
</template>

<script>
import { Popup, CellItem } from "ynet-mobile";
export default {
  components: {
    [Popup.name]: Popup,
    [CellItem.name]: CellItem
  },
  data() {
    return {
      isPopupShow: {
        //底部弹出框
        bottom: true
      },
      hasCard: "2", // 0 为暂无融易通卡  2 为2张或2张以上
      cardlist:[
        {
          id:1,
          isActived:'1',   //是否激活  1 已激活
          cardname:"长沙银行融易通卡",
          account:'6223 **** **** 9876',  
          available_quota:200,   //可用额度
          total_quota:200    //总额度
        },
        {
          id:2,
          isActived:'0',   //是否激活  0 未激活
          cardname:"长沙银行融易通卡",
          account:'3113 **** **** 9876',  
          available_quota:70,   //可用额度
          total_quota:200    //总额度
        },
      ]
    };
  },
  created() {},
  mounted() {},
  methods:{
    //页面跳转
    goto(item,params) {
      let url = `http://172.16.1.239:8080/rong_yi_tong_card/${item}`;
      window.location.href = url;
      // app.api.pushWindow( url,params )
    },

    gotoCardInfo(){
      let params ={}
      this.goto('home_pages/card_information.html',params)
    }
  },
  watch: {},
  computed: {}
};
</script>

<style lang="scss" scoped>
@import "./index.scss";
</style>

